---
description: "Reference for Nitric's v0 Go library - Creates a new Collection."
---

# Go - NewCollection()

Creates a new Collection.

```go
import (
  "fmt"

  "github.com/nitrictech/go-sdk/nitric"
)

func main() {
  profiles, err := nitric.NewCollection("profiles").With(nitric.CollectionReading, nitric.CollectionWriting, nitric.CollectionDeleting)
  if err != nil {
    return
  }

  nitric.Run()
}
```

## Parameters

<Properties>
  <Property name="name" required type="string">
    The unique name of this Collection within the app. Subsequent calls to
    `collection` with the same name will return the same object.
  </Property>
</Properties>

## Access

All Nitric resources provide access permissions you can use to specify the level of access your code needs to the resource. See here for details about infrastructure [security](/get-started/foundations/infrastructure/security).

### Available permissions:

---

**reading**

This permission allows your code to read and query documents from the collection.

---

**writing**

This permission allows your code to write documents to the collection.

---

**deleting**

This permission allows your code to delete documents from the collection.

---

## Examples

### Create a collection

```go
import (
  "fmt"

  "github.com/nitrictech/go-sdk/nitric"
)

func main() {
  profiles, err := nitric.NewCollection("profiles").With(nitric.CollectionReading, nitric.CollectionWriting, nitric.CollectionDeleting)
  if err != nil {
    return
  }

  nitric.Run()
}
```
